package com.supplychainapi.service.impl;


import com.supplychainapi.dao.prod.TbshopMapper;
import com.supplychainapi.model.Tbshop;
import com.supplychainapi.service.RedisService;
import com.supplychainapi.service.TbshopService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TbshopServiceImpl implements TbshopService {

    private Logger logger = LogManager.getLogger(TbshopServiceImpl.class);

	@Autowired
	private RedisService redisService;
	@Autowired
	private TbshopMapper tbshopMapper;

	@Override
	public Tbshop findOne(Tbshop tbshop) {
		return tbshopMapper.selectOne(tbshop);
	}

	@Override
	public Tbshop findOne(String fsShopGUID) {
		Tbshop filter = new Tbshop();
		filter.setFsShopGUID(fsShopGUID);
		Short i = 1;
		filter.setFiStatus(i);
		return tbshopMapper.selectOne(filter);
	}

	@Override
	public String selectByShopIdOrShopName(String name) {
		return tbshopMapper.selectByShopIdOrShopName(name);
	}

	@Override
	public void update(Tbshop tbshop) {
		tbshopMapper.updateByPrimaryKeySelective(tbshop);
	}
}